﻿using EkStudio.com.bean.xml.reflection;
using EkStudio.com.bean.xml.RootInterface;
using EkStudio.com.bean.xml.Unit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EkStudio.com.bean.xml.BillChart
{
    public class BillChartModuleAdvanced:BillObjectInterface
    {
        private string chartView = BeanUtil.CHART_TYPE_VALUE;//统计图类型
        private string content = "";//SQL语句
                                    //曲线图参数配置
        private string groupbyOne = "";//分组类型1

        private string valueX = "";//X轴字段
        private string valueUnit = "";//数值单位
        private string valueXTag = "";//Y轴描述
        private string valueY = "";//Y轴字段

        private bool inverted = false;//反转图形

        //混合统计图参数
        private string valueYTag = "";//Y轴描述2
        private string valueYTwo = "";//y轴第二数字值
        private string valueUnitTwo = "";//第二数字值计量单位

        private string groupbyTwo = "";//饼图数值
        private string orderBy = "";//排序字段

        private string javascript = "";

        //树结构字段
        private bool treeEnable = false;//启用树结构
        private string treeField = "";//树关系字段必须 为int数值
        private string treeJson = "";//树关系json表达内容

        [Xml]
        public string ChartView
        {
            get { return chartView; }
            set { chartView = value; }
        }

        [XmlElement]
        public string Content
        {
            get { return content; }
            set { content = value; }
        }



        
        [Xml]
        public string GroupbyOne
        {
            get
            {
                return groupbyOne;
            }

            set
            {
                groupbyOne = value;
            }
        }
        [Xml]
        public string ValueX
        {
            get
            {
                return valueX;
            }

            set
            {
                valueX = value;
            }
        }


        [XmlTransient]
        public object ParentBean
        {
            get { return null; }

            set { }
        }
        [Xml]
        public string ValueUnit
        {
            get
            {
                return valueUnit;
            }

            set
            {
                valueUnit = value;
            }
        }
        [Xml]
        public string ValueXTag
        {
            get
            {
                return valueXTag;
            }

            set
            {
                valueXTag = value;
            }
        }
        [Xml]
        public string ValueY
        {
            get
            {
                return valueY;
            }

            set
            {
                valueY = value;
            }
        }
        [Xml]
        public bool Inverted
        {
            get
            {
                return inverted;
            }

            set
            {
                inverted = value;
            }
        }
        [Xml]
        public string ValueYTag
        {
            get
            {
                return valueYTag;
            }

            set
            {
                valueYTag = value;
            }
        }
        [Xml]
        public string ValueYTwo
        {
            get
            {
                return valueYTwo;
            }

            set
            {
                valueYTwo = value;
            }
        }
        [Xml]
        public string ValueUnitTwo
        {
            get
            {
                return valueUnitTwo;
            }

            set
            {
                valueUnitTwo = value;
            }
        }
        [Xml]
        public string GroupbyTwo
        {
            get
            {
                return groupbyTwo;
            }

            set
            {
                groupbyTwo = value;
            }
        }
        [Xml]
        public string OrderBy
        {
            get
            {
                return orderBy;
            }

            set
            {
                orderBy = value;
            }
        }
        [XmlElement]
        public string Javascript
        {
            get
            {
                return javascript;
            }

            set
            {
                javascript = value;
            }
        }
        [Xml]
        public bool TreeEnable
        {
            get
            {
                return treeEnable;
            }

            set
            {
                treeEnable = value;
            }
        }

        [Xml]
        public string TreeField
        {
            get
            {
                return treeField;
            }

            set
            {
                treeField = value;
            }
        }
        [Xml]
        public string TreeJson
        {
            get
            {
                return treeJson;
            }

            set
            {
                treeJson = value;
            }
        }

        

        public object Clone()
        {
            BillChartModuleAdvanced clone = new BillChartModuleAdvanced();
            clone.ChartView = ChartView;
            clone.Content = content;
            clone.GroupbyOne = groupbyOne;
            clone.GroupbyTwo = groupbyTwo;
            clone.Inverted = inverted;
            clone.OrderBy = orderBy;
            clone.ValueUnit = valueUnit;
            clone.ValueUnitTwo = valueUnitTwo;
            clone.ValueX = valueX;
            clone.ValueXTag = valueXTag;
            clone.ValueY = valueY;
            clone.ValueYTag = valueYTag;
            clone.ValueYTwo = valueYTwo;

            //树结构
            clone.TreeField = treeField;
            clone.TreeJson = treeJson;

            return clone;
        }
    }
}
